package ar.com.candoit.dao;

import java.beans.PropertyEditorSupport;

import ar.com.candoit.beans.Adress;
import ar.com.candoit.service.AdressService;


public class AdressEditor  extends PropertyEditorSupport {
 
    private final AdressService adressService;
 
    public AdressEditor(AdressService adressService) {
        this.adressService = adressService;
    }
 
	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		Adress a = adressService.get(Long.parseLong(text));
        setValue(a);
	}
 
}